<template>
  <div class="under-development">
    <div class="content-wrapper">
      <div class="icon-section">
        <el-icon class="development-icon">
          <Tools />
        </el-icon>
      </div>
      
      <div class="text-section">
        <h1>{{ pageTitle }}</h1>
        <p class="subtitle">页面开发中...</p>
        <p class="description">
          该功能正在紧张开发中，敬请期待！
        </p>
      </div>
      
      <div class="info-section">
        <el-card class="info-card">
          <div class="info-item">
            <span class="label">当前路由：</span>
            <span class="value">{{ currentRoute }}</span>
          </div>
          <div class="info-item">
            <span class="label">菜单ID：</span>
            <span class="value">{{ menuId }}</span>
          </div>
          <div class="info-item">
            <span class="label">页面级别：</span>
            <span class="value">Level {{ level }}</span>
          </div>
        </el-card>
      </div>
      
      <div class="action-section">
        <el-button type="primary" @click="goBack">
          <el-icon><ArrowLeft /></el-icon>
          返回上一页
        </el-button>
        <el-button @click="goHome">
          <el-icon><House /></el-icon>
          返回首页
        </el-button>
      </div>
    </div>
  </div>
</template>

<script setup>
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { Tools, ArrowLeft, House } from '@element-plus/icons-vue'

const route = useRoute()
const router = useRouter()

// 获取页面标题
const pageTitle = computed(() => {
  if (route.name === 'NotFound') {
    return '页面不存在'
  }
  return route.meta?.title || '页面开发中'
})

// 获取当前路由
const currentRoute = computed(() => {
  return route.path
})

// 获取菜单ID
const menuId = computed(() => {
  return route.meta?.menuId || 'N/A'
})

// 获取页面级别
const level = computed(() => {
  return route.meta?.level || 'N/A'
})

// 返回上一页
const goBack = () => {
  router.go(-1)
}

// 返回首页
const goHome = () => {
  router.push('/index')
}
</script>

<style scoped>
.under-development {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.content-wrapper {
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.icon-section {
  margin-bottom: 30px;
}

.development-icon {
  font-size: 120px;
  color: #fff;
  opacity: 0.9;
  animation: rotate 3s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.text-section {
  margin-bottom: 40px;
}

.text-section h1 {
  font-size: 48px;
  color: #fff;
  margin: 0 0 16px 0;
  font-weight: 300;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 24px;
  color: #fff;
  margin: 0 0 16px 0;
  opacity: 0.9;
}

.description {
  font-size: 16px;
  color: #fff;
  margin: 0;
  opacity: 0.8;
  line-height: 1.6;
}

.info-section {
  margin-bottom: 40px;
}

.info-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
}

.info-card :deep(.el-card__body) {
  padding: 24px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: #fff;
}

.info-item:last-child {
  margin-bottom: 0;
}

.label {
  font-weight: 500;
  opacity: 0.8;
}

.value {
  font-weight: 600;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: var(--font-size-base);
}

.action-section {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.action-section .el-button {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.action-section .el-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


</style>
